package com.link.base.base.codereview.service;

import com.link.base.base.codereview.dao.mybatis.mapper.SysCodeReviewApproveInfoMapper;
import com.link.base.base.codereview.dao.mybatis.mapper.SysCodeReviewMapper;
import com.link.base.base.codereview.model.SysCodeReviewApproveInfo;
import com.link.core.basic.dao.mapper.BasicMapper;
import com.link.core.basic.database.DataSource;
import com.link.core.basic.database.DataSourceType;
import com.link.core.basic.service.BasicServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;


/**
 * 代码审核历史-
 *
 * @author 谢鑫
 * @date 2019/09/25 09:58
 */
@Service
@DataSource(value = DataSourceType.LINKADMIN)
public class SysCodeReviewApproveInfoServiceImpl extends BasicServiceImpl<SysCodeReviewApproveInfo> implements SysCodeReviewApproveInfoService {

    @Resource
    private SysCodeReviewApproveInfoMapper sysCodeReviewApproveInfoMapper;

    @Resource
    private SysCodeReviewMapper sysCodeReviewMapper;

    @Override
    public BasicMapper<SysCodeReviewApproveInfo> getBasicMapper() {
        return sysCodeReviewApproveInfoMapper;
    }

    /**
     * 审核接口
     *
     * @author LiYang
     * @date 20191031
     * @param sysCodeReviewApproveInfo
     * @throws Exception
     */
    @Override
    public void approval(SysCodeReviewApproveInfo sysCodeReviewApproveInfo) throws Exception {
//        QueryParams qps = new QueryParams();
//        qps.setFiltersRaw("[{\"id\":\"param0\",\"property\":\"id\",\"value\":" +
//                sysCodeReviewApproveInfo.getCodeId() + ",\"operator\":\"=\"}]");
//        SysCodeReview sysCodeReview = new SysCodeReview();
//        BasicModel.transformClass(sysCodeReview, qps);
//        //查询审核记录行
//        List<SysCodeReview> result = sysCodeReviewMapper.queryByExamplePage(sysCodeReview);
//        if (null == result || result.isEmpty() || result.size() > 1) {
//            throw new BasicServiceException("查询审核记录行结果出现异常或未找到。");
//        }

    }
}

